package com.juku2024.juku.adapter

import android.widget.ImageView
import com.juku2024.juku.R
import com.juku2024.juku.model.CarouselModel
import com.juku2024.juku.tools.ImageUtils
import com.zhpan.bannerview.BaseBannerAdapter
import com.zhpan.bannerview.BaseViewHolder

class HomeBannerAdapterNew: BaseBannerAdapter<CarouselModel>() {

    override fun bindData(holder: BaseViewHolder<CarouselModel>?, data: CarouselModel?, position: Int, pageSize: Int) {
        val imageView = holder?.findViewById<ImageView>(R.id.iv_banner)
        ImageUtils.loadImage(imageView, data?.pic)
        holder?.setText(R.id.tv_banner_name, data?.name)
    }

    override fun getLayoutId(viewType: Int): Int {
        return R.layout.item_home_banner
    }
}